A controller is a specialized processor that ordinarily does not have all of the features of a general purpose processor. Typically, a controller and a general purpose processor handle I/O operations differently. An example of an I/O device is a motor that the controller turns on and off according to a program that is executed by either a controller or a general purpose processor.
A controller has ports that can be connected to I/O devices. An I/O port has a register that is used for transferring data bytes between the controller and the I/O device. (The term "byte" will be used to mean a multi-bit unit of data that is transferred on the data busses of the controller, without regard to the specific number of bits for a particular controller.) Both the controller and the device can read and write data of various kinds at the port. Conventional hardware or programming prevents overlapping read and write operations and tells the controller and the device when to read the port register.
In a controller, a byte for an I/O transfer passes through an arithmetic and logic unit (ALU) and the steps of the transfer process are controlled by its instruction decode and control unit. By contrast, a general purpose processor commonly handles I/O operations by issuing I/O instructions to another processor (a data channel) that issues commands to an I/O device and independently handles the data path between the I/O device and main memory.